﻿<local:BaseWindow
    x:Class="LenovoLegionToolkit.WPF.Windows.Utils.DeviceInformationWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:LenovoLegionToolkit.WPF.Controls"
    xmlns:local="clr-namespace:LenovoLegionToolkit.WPF.Windows"
    xmlns:resources="clr-namespace:LenovoLegionToolkit.WPF.Resources"
    xmlns:utils="clr-namespace:LenovoLegionToolkit.WPF.Utils"
    xmlns:wpfui="http://schemas.lepo.co/wpfui/2022/xaml"
    Title="{x:Static resources:Resource.DeviceInformationWindow_Title}"
    Width="500"
    ExtendsContentIntoTitleBar="True"
    FlowDirection="{x:Static utils:LocalizationHelper.Direction}"
    Loaded="DeviceInformationWindow_Loaded"
    ResizeMode="CanMinimize"
    ShowInTaskbar="False"
    SizeToContent="Height"
    WindowStartupLocation="CenterOwner">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <wpfui:TitleBar
            Grid.Row="0"
            CanMaximize="false"
            ShowMaximize="false"
            ShowMinimize="false"
            UseSnapLayout="false" />

        <Grid
            Grid.Row="0"
            Height="24"
            Margin="12,8,12,8">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <TextBlock
                Grid.Column="0"
                VerticalAlignment="Center"
                FontSize="12"
                IsHitTestVisible="False"
                Text="{x:Static resources:Resource.DeviceInformationWindow_Title}" />

        </Grid>

        <wpfui:DynamicScrollViewer Grid.Row="1">
            <StackPanel Margin="16,0,16,12">

                <TextBlock
                    Margin="0,16,0,24"
                    FontSize="24"
                    FontWeight="Medium"
                    Text="{x:Static resources:Resource.DeviceInformationWindow_Device_Title}" />

                <wpfui:CardControl Margin="0,0,0,8" Click="DeviceCardControl_Click">
                    <wpfui:CardControl.Header>
                        <controls:CardHeaderControl Title="{x:Static resources:Resource.DeviceInformationWindow_Manufacturer_Title}" />
                    </wpfui:CardControl.Header>
                    <Label x:Name="_manufacturerLabel" />
                </wpfui:CardControl>

                <wpfui:CardControl Margin="0,0,0,8" Click="DeviceCardControl_Click">
                    <wpfui:CardControl.Header>
                        <controls:CardHeaderControl Title="{x:Static resources:Resource.DeviceInformationWindow_Model_Title}" />
                    </wpfui:CardControl.Header>
                    <Label x:Name="_modelLabel" />
                </wpfui:CardControl>

                <wpfui:CardControl Margin="0,0,0,8" Click="DeviceCardControl_Click">
                    <wpfui:CardControl.Header>
                        <controls:CardHeaderControl Title="{x:Static resources:Resource.DeviceInformationWindow_MachineType_Title}" />
                    </wpfui:CardControl.Header>
                    <Label x:Name="_mtmLabel" />
                </wpfui:CardControl>
                <wpfui:CardControl Margin="0,0,0,8" Click="DeviceCardControl_Click">
                    <wpfui:CardControl.Header>
                        <controls:CardHeaderControl Title="{x:Static resources:Resource.DeviceInformationWindow_SerialNumber_Title}" />
                    </wpfui:CardControl.Header>
                    <Label x:Name="_serialNumberLabel" />
                </wpfui:CardControl>

                <wpfui:CardControl Margin="0,0,0,8" Click="DeviceCardControl_Click">
                    <wpfui:CardControl.Header>
                        <controls:CardHeaderControl Title="{x:Static resources:Resource.DeviceInformationWindow_BiosVersion_Title}" />
                    </wpfui:CardControl.Header>
                    <Label x:Name="_biosLabel" />
                </wpfui:CardControl>

                <Grid Margin="0,16,0,24">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <TextBlock
                        Grid.Column="0"
                        FontSize="24"
                        FontWeight="Medium"
                        Text="{x:Static resources:Resource.DeviceInformationWindow_Warranty_Title}" />
                    <wpfui:Button
                        x:Name="_refreshWarrantyButton"
                        Grid.Column="1"
                        Click="RefreshWarrantyButton_OnClick"
                        Icon="ArrowClockwise32" />
                </Grid>

                <wpfui:CardControl Margin="0,0,0,8">
                    <wpfui:CardControl.Header>
                        <controls:CardHeaderControl Title="{x:Static resources:Resource.DeviceInformationWindow_WarrantyStartDate_Title}" />
                    </wpfui:CardControl.Header>
                    <Label x:Name="_warrantyStartLabel" Content="-" />
                </wpfui:CardControl>

                <wpfui:CardControl Margin="0,0,0,8">
                    <wpfui:CardControl.Header>
                        <controls:CardHeaderControl Title="{x:Static resources:Resource.DeviceInformationWindow_WarrantyEndDate_Title}" />
                    </wpfui:CardControl.Header>
                    <Label x:Name="_warrantyEndLabel" Content="-" />
                </wpfui:CardControl>


                <wpfui:CardAction
                    x:Name="_warrantyLinkCardAction"
                    Margin="0,8,0,8"
                    Click="WarrantyLinkCardAction_OnClick"
                    Content="{x:Static resources:Resource.DeviceInformationWindow_LenovoSupport}"
                    Icon="Open24"
                    IsChevronVisible="False"
                    IsEnabled="False" />

            </StackPanel>

        </wpfui:DynamicScrollViewer>

        <wpfui:Snackbar
            x:Name="_snackBar"
            Grid.Row="1"
            HorizontalAlignment="Center"
            CloseButtonEnabled="False"
            Icon="Checkmark24"
            Timeout="1000" />
    </Grid>
</local:BaseWindow>
